#ifndef  _HALL_H
#define  _HALL_H


#define DEG_360 	65535
#define DEG_300 	54613
#define DEG_240 	43690
#define DEG_180 	32768
#define DEG_120 	21845
#define DEG_90  	16384
#define DEG_60  	10923
#define DEG_0   	0



typedef struct 
{	
	unsigned char  Value;
	unsigned char  Value_Pre;
	unsigned char  Num_Pre;
	unsigned char  Num;	
	unsigned char  Test_Num;
	unsigned int   Speed_Cnt;
	unsigned int   Speed;	
	signed int Angle_Correct;
	signed int Delta_Theta;
	signed int Fre;	
	signed int AngelEstimate;
	signed int AngelCorrect;
	signed int AngelAdwanced;
	signed int AngelEstimateAfterCor; 
}HALL_T;



extern HALL_T	Hall;
extern const signed int HALL_Angle_Table[6];
extern const signed int HALL_Test_Table[6];
extern void 	HALL_Init(HALL_T *p);
extern void 	GET_HALL_STATE(HALL_T *HALL_Sense);
extern void 	BLDC_Driver(unsigned char Index,  unsigned short int Pwm);
extern void 	MC_Hall_Start(HALL_T *p);

#endif


